<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。
      (function () {
        const test = ['aa', 'b', 'cc', 'd', 'ee', 'f'];
        const result = test.filter((item) => item.length >= 2); //['aa', 'cc', 'ee']
        console.log(result);
      })();
    </script>
  </body>
</html>
